﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CPPEI
{
    public class ErrorCodeDictionary
    {
        public string Language { get; private set; }
        private Hashtable _hashtable;

        public ErrorCodeDictionary(string language)
        {
            Language = language;
            _hashtable = new Hashtable();
        }

        public void Add(int code, string message)
        {
            if (_hashtable.Contains(code))
            {
                _hashtable[code] = message;
            }
            else
            {
                _hashtable.Add(code, message);
            }
        }

        public string GetMessage(int code)
        {
            object value = _hashtable[code];
            if(value!=null)
            {
                return (string)value;
            }
            return null;
        }
    }
}
